package oop5.sonar;

public class Sonar {	//声呐
    public static void main(String[] args) {
        Sonar sonar = new Sonar();
        sonar.scan(new Fish("金鱼"));
        sonar.scan(new Oscar("攻击型潜艇"));
    }

    public void scan(Swimming swimming) {
        System.out.println("声呐扫描到：");
        swimming.swim();
    }
}
